import { dividerProps } from "vant";
export const filterMenuProps = {
  data: {
    type: Array as () => IFilterMenuPropsData[],
    default: () => [],
  },
  choose: {
    type: Array as () => IFilterMenuChoose[],
    default: () => [],
  },
  modelValue: {
    type: Object,
    default: {},
  },
};

export interface IFilterMenuChoose {
  type?:
    | "productType"
    | "area"
    | "datePicker"
    | "calendar"
    | "field"
    | "idleTime"
    | "exhibitionType"
    | "policyType"
    | "packType"
    | "agriculturalType"
    | "plantType"
    | "workType";

  key?: string;
  keys?: string[];
  title?: string;
  comType?: "multiple" | "single" | "calendar" | "datePicker" | "cascade";
  data?: any[];
  onChange?: (data: any) => void;
}
export type IFilterMenuPropsData = {
  title: string;
  key: string;
  render?: () => any;
} & (IFilterMenu | IFilterArea | IFilterDatePicker);

export interface IFilterMenu {
  type: "single";
}
export interface IFilterDatePicker {
  type: "datePicker";
}
export interface IFilterArea {
  type: "multiple";
}

export interface IFilterMenuOptions {
  text: string;
  value: string;
}

export interface IFilterMenuAreaOptions {
  name: string;
  value: string;
  children: IFilterMenuAreaOptions[];
}
